Ext.define('MyApp.view.MainPanel', {
    extend:'Ext.dataview.List',
    alias:'widget.mainPanel',

    config:{
        store:'Countries',
        grouped: true,
        indexBar: false,
        onItemDisclosure: {
            scope: 'test',
            handler: function(record, btn, index) {
                window.location.href='../companyusers/addcompanyUser.jsp?groupid='+groupid;
            }
        },
        itemTpl:'<div class="myContent">' +'{fullname}</b></div>',
        emptyText:'<div class="myContent">没有任何记录</div>',

        items:[
            {
                xtype:'toolbar',
                docked:'top',

                // Make the toolbar scrollable
                scrollable:{
                    direction:'horizontal',
                    indicators:false
                },

                // Add several items into the toolbar
                items:[

                    { 
                    	ui:'back', 
                    	text:'返回',
                    	handler:function () {
                            window.location.href = '../companycomminutes/companyCommunicationsList.jsp';
                        }
                    },
                    { xtype:'spacer' },
                    {
                        ui:'action',
                        text:'增加',
                        handler:function () {
                            window.location.href = '../companyusers/addcompanyUser.jsp?groupid='+groupid;
                        }
                    }
                ]},
            {
                xtype:'toolbar',
                docked:'top',

                items:[
                    {
                        xtype:'searchfield',
                        placeHolder:'Search...',
                        itemId:'searchBox'
                    }
                ]
            }
        ]
    }
});